From f07d71ce3948c6a8f11f137e1f4b716704c89bf0 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Thu, 24 Jun 2004 15:04:30 +0000 Subject: [PATCH] bitkeeper revision 1.1014 (40daed7e9y-gp5z9q05byc8SDgQ1Mg) manual merge --- tools/xc/lib/xc_domain.c | 18 ++++++++++++++++++ tools/xc/lib/xc_linux_save.c | 19 ++++++++++--------- xen/common/shadow.c | 8 ++++---- xen/include/hypervisor-ifs/dom0_ops.h | 2 +- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/tools/xc/lib/xc_domain.c b/tools/xc/lib/xc_domain.c index 20a323a047..38b3e2ee34 100644 --- a/tools/xc/lib/xc_domain.c +++ b/tools/xc/lib/xc_domain.c @@ -117,6 +117,24 @@ int xc_domain_getinfo(int xc_handle, return nr_doms; } +int xc_domain_getfullinfo(int xc_handle, + u32 domid, + dom0_op_t *op, + full_execution_context_t *ctxt ) +{ + int rc; + op->cmd = DOM0_GETDOMAININFO; + op->u.getdomaininfo.domain = (domid_t)domid; + op->u.getdomaininfo.ctxt = ctxt; + + rc = do_dom0_op(xc_handle, op); + if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 ) + return -ESRCH; + else + return rc; +} + + int xc_shadow_control(int xc_handle, u32 domid, unsigned int sop, diff --git a/tools/xc/lib/xc_linux_save.c b/tools/xc/lib/xc_linux_save.c index 02f67dfc27..e93120a08b 100644 --- a/tools/xc/lib/xc_linux_save.c +++ b/tools/xc/lib/xc_linux_save.c @@ -319,12 +319,17 @@ int xc_linux_save(int xc_handle, /* Ensure that the domain exists, and that it is stopped. */ - if ( xc_domain_pause( xc_handle, domid, &op, &ctxt ) ) + if ( xc_domain_pause( xc_handle, domid ) ) { PERROR("Could not pause domain"); goto out; } + if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) ) + { + PERROR("Could not get full domain info"); + goto out; + } memcpy(name, op.u.getdomaininfo.name, sizeof(name)); shared_info_frame = op.u.getdomaininfo.shared_info_frame; @@ -381,7 +386,7 @@ int xc_linux_save(int xc_handle, pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT; live_mfn_to_pfn_table = - mfn_mapper_map_single(xc_handle, ~0ULL, + mfn_mapper_map_single(xc_handle, ~0UL, PAGE_SIZE*1024, PROT_READ, mfn_to_pfn_table_start_mfn ); } @@ -805,7 +810,7 @@ int xc_linux_save(int xc_handle, DPRINTF("Start last iteration\n"); last_iter = 1; - xc_domain_pause( xc_handle, domid, &op, NULL ); + xc_domain_pause( xc_handle, domid ); } @@ -839,13 +844,9 @@ int xc_linux_save(int xc_handle, } /* Get the final execution context */ - op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = (domid_t)domid; - op.u.getdomaininfo.ctxt = &ctxt; - if ( (do_dom0_op(xc_handle, &op) < 0) || - ((u32)op.u.getdomaininfo.domain != domid) ) + if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) ) { - PERROR("Could not get info on domain"); + PERROR("Could not get full domain info"); goto out; } diff --git a/xen/common/shadow.c b/xen/common/shadow.c index 810c01b88e..de5fe4b4fa 100644 --- a/xen/common/shadow.c +++ b/xen/common/shadow.c @@ -426,10 +426,10 @@ static int shadow_mode_table_op(struct domain *d, { int i; - sc->stats.fault_count = p->mm.shadow_fault_count; - sc->stats.dirty_count = p->mm.shadow_dirty_count; - sc->stats.dirty_net_count = p->mm.shadow_dirty_net_count; - sc->stats.dirty_block_count = p->mm.shadow_dirty_block_count; + sc->stats.fault_count = d->mm.shadow_fault_count; + sc->stats.dirty_count = d->mm.shadow_dirty_count; + sc->stats.dirty_net_count = d->mm.shadow_dirty_net_count; + sc->stats.dirty_block_count = d->mm.shadow_dirty_block_count; if( d->tot_pages > sc->pages || !sc->dirty_bitmap || !d->mm.shadow_dirty_bitmap ) diff --git a/xen/include/hypervisor-ifs/dom0_ops.h b/xen/include/hypervisor-ifs/dom0_ops.h index 7eb5f548dc..9cb5656b3e 100644 --- a/xen/include/hypervisor-ifs/dom0_ops.h +++ b/xen/include/hypervisor-ifs/dom0_ops.h @@ -279,7 +279,7 @@ typedef struct { memory_t pages; /* 16: size of buffer, updated with actual size */ MEMORY_PADDING; /* OUT variables. */ - dom0_shadow_control_stats_t; + dom0_shadow_control_stats_t stats; } PACKED dom0_shadow_control_t; -- 2.30.2